package gui.beans;

import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.JScrollPane;

import datos.Tarea;

@SuppressWarnings("serial")
public class ProgressPanel extends JPanel {

	private ProgressTree tree = null;
	private JScrollPane scroll = null;
	
	public ProgressPanel(){
		super();
		initialize();
	}
	
	private void initialize(){
		setLayout(new BorderLayout());
		add(getScroll(), BorderLayout.CENTER);
	}
	
	private JScrollPane getScroll(){
		if(scroll == null){
			scroll = new JScrollPane();
			scroll.getViewport().add(getTree());
		}
		return scroll;
	}
	
	private ProgressTree getTree(){
		if(tree == null){
			tree = new ProgressTree();
		}
		return tree;
	}
	
	public void setEnabled(boolean flag){
		super.setEnabled(flag);
		getTree().setEnabled(flag);
	}
	
	public void setTarea(Tarea tarea){
		//getTree().setTarea(tarea);
	}
}
